package cn.clx.ymcc.feign;

import cn.clx.ymcc.domain.Login;
import cn.clx.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginFeignBallbackFactory implements FallbackFactory<LoginFeignClient> {

    @Override
    public LoginFeignClient create(Throwable throwable) {
        return new LoginFeignClient() {
            @Override
            public JSONResult insert(Login login) {
                return JSONResult.error("服务不可达，请重试");
            }
        };
    }
}
